#ifndef _ENTITY_H_
#define _ENTITY_H_
#include "Component.h"
namespace fe
{
    class Entity
    {
    public:
        Entity();
        ~Entity();

        /*Component* getComponent(Component::TYPE type) {
            return m_component[type];
        }*/

        // for now i would like this to be templated!
        template<typename T>
        T* getComponent(Component::TYPE type)
        {
            return static_cast<T*>(m_component[type]);
            // may want to do return (T*)m_component[type];
        }

        void addComponent(Component::TYPE type, Component* c);

        bool canHave(Component::TYPE type)
        {
            if(type == Component::Animation) { // needs a sprite to animate
                return (m_component[Component::Sprite] != NULL);
            }

            else if(type == Component::Collision) { // needs a positioin to collide
                return (m_component[Component::Position] != NULL);
            }

            return true;
        }

    private:

        Component *m_component[Component::Max]; // this way there is a constant amout of components
                                                // but some entities have null components that need not
                                                // be updated or even refrenced !! they basically dont exits :D
        int id;
    };
}

#endif
